<template>
	<div class="shopm">
		
		<view class="weui-cells__title">填写您的宝贵评论</view>
		<div class="weui-cells weui-cells_after-title">
			<view class="weui-cell">
				
				<view class="weui-cell__bd">
					<textarea class="weui-textarea" placeholder="留下您的宝贵意见" style="height: 3.3em" v-model="content" />
					
				</view>
			</view>
		</div>
		
		

		<button  class="weui-btn" type="primary submit" @click="submit">提交评论</button>
	</div>
</template>

<script>
	import { requests } from "../../../static/js/network"
	export default {
		data() {
			return {
				orderdetail: {},
				title: '',
				description: '',
				banner: '',
				content:''
			}
		},
		onLoad() {
			
			Object.assign(this.$data, this.$options.data())
		},
		methods: {

			

			submit() {
				let self = this
				

				requests({
					url: 'https://tp5.blver.cn/api/wechat/pinglun',
					method: 'POST',
					header: {
						'content-type': 'application/json',
						'content-type': 'application/x-www-form-urlencoded' // 默认值
					},
					data: {
						content:self.content,
						orderno: self.$root.$mp.query.oid,
				
						session3rd: wx.getStorageSync('userinfo').session3rd
					},
					success: function(res) {

						console.log(res)
						if(res.data.status == 'success') {
							wx.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							
							setTimeout(function(){
								wx.reLaunch({
								  url: '/pages/index/main'
								})
							},2000)
						} else if(res.data.status == 'error') {
							wx.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
						}
						//self.orderdetail=res.data.data

						//self.content=self.classlist[0].goods_content.replace(/"\/static/g, '"https://tp5.blver.cn/static').replace(/"\/static/g, '"https://tp5.blver.cn/static').replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
					}
				})
			}
		}
	}
</script>

<style scoped>
	.nopic {
		
		color: #444444;
		width: 97vw;
		margin: 0 auto;
		border: 6px solid #fff;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
	}
	
	.shopm {
		
		height: 100vh;
	}
	
	.weui-cells_after-title {
		border-bottom: 20rpx solid #ccc;
	}
	
	.weui-cells__title {
		background: #fff;
		padding: 20rpx;
	}
	
	.submit {
		position: fixed;
		bottom: 0;
		
	}
	
	.nobott {
		margin-bottom: 0;
	}
</style>